﻿using IDAdmin.Common;
using IDAdmin.Pages;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace IDAdmin
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            JobScheduler js = new JobScheduler();
            js.startInsertGoldSave();
            js.startInsertScoredCardSave();
            js.startTranferLevelVN();
            js.startTranferFilledCard();
            js.startCronPremiumLogin();
            js.startCronLoginNewSave();
            js.startCronLevelDis();
            js.startCronLevelLoss();
            js.startCronLevelSave();

            //CronLoginNewSave.work();
            //CronPremiumLogin.work();
            //DateTime date = new DateTime(2015,5,6);
            //LoginNewSaveStatistics.cronLoginNewSave(date);
            //clearCache();
        }
        private void clearCache()
        {
            IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();

            while (enumerator.MoveNext())
            {

                HttpContext.Current.Cache.Remove(enumerator.Key.ToString());

            }
        }
        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}